home *** CD-ROM | disk | FTP | other *** search
/ Languguage OS 2 / Languguage OS II Version 10-94 (Knowledge Media)(1994).ISO / language / dino / dino_bot.1 / examples / helloworld / ex4.d < prev    next >
Encoding:
Text File  |  1991-03-10  |  907 b   |  41 lines

  1. /* Copyright, 1990, Regents of the University of Colorado */
  2. /* This program prints out messages from two composite procedures, inside of
  3.  * two different one dimensional environment structures. */
  4.  
  5. #define P1 8
  6. #define P2 6
  7.  
  8. environment node1[P1:id] {
  9.  
  10.   composite part1()
  11.   {
  12.     printf ("node1[%d] says hello from part1()#\n", id);
  13.   }
  14.  
  15. }
  16.  
  17. environment node2[P2:id] {      /* ==> Multiple environment structures are
  18.                                        allowed, and are simply declared one
  19.                                        after another. */
  20.  
  21.   composite part2()
  22.   {
  23.     printf ("node2[%d] says hello from part2()#\n", id);
  24.   }
  25.  
  26. }
  27.  
  28. environment host {
  29.  
  30.   void main ()
  31.   {
  32.     printf ("host says hello\n");
  33.  
  34.     part1()#;
  35.     part2()#;                   /*==> Part1()# must finish before Part2()#
  36.                                        begins execution. */
  37.  
  38.     printf ("host says goodbye\n");
  39.   }
  40. }
  41.